<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="https://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/BasicTemplate.dwt" codeOutsideHTMLIsLocked="false" -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- InstanceBeginEditable name="doctitle" -->
<title>Rewired Documentation | Rewired Standalone Input Module</title>
<!-- InstanceEndEditable -->
<!-- InstanceParam name="isRoot" type="boolean" value="false" -->
<!-- InstanceParam name="wide" type="boolean" value="false" -->
<link href="files/css/styles.css" rel="stylesheet" type="text/css" />
<!-- Favicons -->
<link rel="icon" type="image/x-icon" href="/projects/rewired/files/images/favicon.ico?v=1" />
<!-- Apple Icons -->
<!-- For iPad with high-resolution Retina display running iOS = 7: -->
<link rel="apple-touch-icon-precomposed" sizes="152x152" href="files/images/favicon_152x152.png?v=1">
<!-- For iPad with high-resolution Retina display running iOS = 6: -->
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="files/images/favicon_144x144.png?v=1">
<!-- For iPhone with high-resolution Retina display running iOS = 7: -->
<link rel="apple-touch-icon-precomposed" sizes="120x120" href="files/images/favicon_120x120.png?v=1">
<!-- For iPhone with high-resolution Retina display running iOS = 6: -->
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="files/images/favicon_114x114.png?v=1">
<!-- For the iPad mini and the first- and second-generation iPad on iOS = 7: -->
<link rel="apple-touch-icon-precomposed" sizes="76x76" href="files/images/favicon_76x76.png?v=1">
<!-- For the iPad mini and the first- and second-generation iPad on iOS = 6: -->
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="files/images/favicon_72x72.png?v=1">
<!-- For non-Retina iPhone, iPod Touch, and Android 2.1+ devices: -->
<link rel="apple-touch-icon-precomposed" href="files/images/favicon_57x57.png?v=1">
</head>

<body>


<div class="container">

    <div class="google-search-bar">
        <script>
          (function() {
            var cx = '007961148920562332911:oocvtwz5jce';
            var gcse = document.createElement('script');
            gcse.type = 'text/javascript';
            gcse.async = true;
            gcse.src = 'https://cse.google.com/cse.js?cx=' + cx;
            var s = document.getElementsByTagName('script')[0];
            s.parentNode.insertBefore(gcse, s);
          })();
        </script>
        <gcse:search></gcse:search>
    </div>

  <div class="content">
	
	
	 
    <div class="page-body">
	
    
         
	    
      	<div class="sidebar-nav">
	        <h4><a href="Documentation.html">Documentation</a></h4>
	        <ul>
	          <li><a href="Overview.html">Overview</a></li>
	          <li><a href="ReleaseNotes.txt">Release Notes</a></li>
          </ul>
	        <strong>Essentials:</strong>
            <ol>
              <li><a href="Installation.html">Installation</a></li>
              <li><a href="QuickStart.html">Quick Start</a></li>
              <li><a href="BasicUsage.html">Basic Usage</a></li>
              <li><a href="Deployment.html">Deployment</a></li>
              <li><a href="BestPractices.html">Best Practices</a></li>
              <li><a href="RewiredEditor.html">Rewired Editor</a></li>
              <li><a href="https://guavaman.com/projects/rewired/docs/api-reference" target="_blank">API Reference</a></li>
            </ol>
            <strong>Concepts:</strong>
            <ul>
              <li><a href="InputManager.html">Input Manager</a></li>
              <li><a href="Players.html">Players</a></li>
              <li><a href="Actions.html">Actions</a></li>
              <li><a href="InputBehaviors.html">Input Behaviors</a></li>
              <li><a href="Controllers.html">Controllers</a></li>
              <li><a href="ControllerMaps.html">Controller Maps</a></li>
              <li><a href="ControllerTemplates.html">Controller Templates</a></li>
              <li><a href="MapCategories.html">Map Categories</a></li>
              <li><a href="Layouts.html">Layouts</a></li>
              <li><a href="LayoutManager.html">Layout Manager</a></li>
              <li><a href="MapEnabler.html">Map Enabler</a></li>
              <li><a href="CustomControllers.html">Custom Controllers</a></li>
            </ul>
            <strong>Extras:</strong>
            <ul>
              <li><a href="ControlMapper.html" title="Control Mapper">Control Mapper</a></li>
	          <li><a href="TouchControls.html" title="Touch Controls">Touch Controls</a></li>
              <li><a href="RewiredStandaloneInputModule.html">Rewired Standalone Input Module</a></li>
	          <li><a href="UnityInputOverride.html" title="Unity Input Override">Unity Input Override</a></li>
            </ul>
            <strong>Misc:</strong>
            <ul>
	          <li><a href="ComponentControls.html" title="Component Controls">Component Controls</a></li>
	          <li><a href="PlayerControllers.html" title="Player Controllers">Player Controllers</a></li>
	          <li><a href="InputMapper.html" title="Input Mapper">Input Mapper</a></li>
	          <li><a href="UserDataStore.html" title="User Data Store">User Data Store</a></li>
            </ul>
            <strong>How To's:</strong>
            <ul>
            	<li><a href="HowTos.html">See all topics...</a></li>
            </ul>
            <strong>Help:</strong>
            <ul>
              <li><a href="SupportedControllers.html" title="Supported Controllers">Supported Controllers</a></li>
              <li><a href="Overview.html#tested-platforms" title="Tested Platforms">Tested Platforms</a></li>
              <li><a href="Troubleshooting.html" title="Troubleshooting">Troubleshooting</a></li>
              <li><a href="KnownIssues.html">Known Issues</a></li>
              <li><a href="SpecialPlatformSupport.html" title="Special Platform Support">Special Platform Support</a></li>
	          <li><a href="Examples.html" title="Examples">Examples</a></li>
              <li><a href="Integration.html">Integrations</a></li>
	          <li><a href="Updating.html" title="Updating Rewired">Updating Rewired</a></li>
            </ul>
            <strong>FAQ</strong>
            <ul>
            	<li><a href="FAQ.html">See all topics...</a></li>
            </ul>
            <strong>Unity Help:</strong>
            <ul>
              <li><a href="https://docs.unity3d.com/Manual/" target="_blank">Unity Manual</a></li>
              <li><a href="https://docs.unity3d.com/ScriptReference/" target="_blank">Unity Script Reference</a></li>
              <li><a href="https://unity3d.com/learn/tutorials/modules" target="_blank">Unity Tutorials</a></li>
            </ul>
            <strong>Links:</strong>
            <ul>
              <li><a href="https://guavaman.com/projects/rewired">Rewired Website</a></li>
              <li><a href="https://guavaman.com/projects/rewired/docs">Web Documentation</a></li>
            </ul>
        </div>
        
    
    	<div class="main-body">
	        <div class="logo"><a href="https://guavaman.com/projects/rewired" title="Rewired"><img src="files/images/rewired-logo.png" width="173" height="139" alt="Rewired" /></a></div>
                     
          <h1>
            <!-- InstanceBeginEditable name="PageHeader" -->Rewired Standalone Input Module
      <!-- InstanceEndEditable -->
            </h1>
            
			<!-- InstanceBeginEditable name="MainBody" -->

    <ul>
      <li><a href="#overview">Overview</a></li>
      <li><a href="#quick-setup">Quick Setup</a></li>
      <li><a href="#event-system-and-component">Event System and Component</a></li>
      <li><a href="#rewired-actions">Rewired Actions</a></li>
      <li><a href="#rewired-input-manager-settings">Rewired Input Manager Settings</a></li>
      <li><a href="#inspector-options">Inspector Options</a></li>
      <li><a href="#player-mouse">Player Mouse</a></li>
      <li><a href="#troubleshooting">Troubleshooting</a></li>
      <li><a href="#faq">FAQ</a></li>
    </ul>
    <p>&nbsp;</p>
    <hr />
    <h3><a name="overview" id="overview"></a>Overview</h3>
<p>This is an EventSystem input module component that can be used in place of Unity's StandaloneInputModule. The purpose of this module is to allow Rewired to control navigation of Unity's UI instead of the default UnityEngine.Input.</p>
    <p>When you install or upgrade Rewired, it will automatically install the RewiredStandaloneInputModule.cs file in the Rewired/Integration/UnityUI folder provided you are running Unity 4.6 or greater.</p>
    <p>This component must be added to the Event System in the scene and the default StandaloneInputModule must be disabled or removed. This will allow the UnityUI system to receive input from Rewired. You must also create the appropriate Actions in the Rewired Editor to match the Actions listed in the RewiredStandaloneInputModule and assign these Actions to one or more Controller Maps then assign those to one or more Players.</p>
    <p><strong>IMPORTANT:</strong></p>
    <p>The Rewired Standalone Input Module is not a re-invention of Unity's UI system. It is not a new UI system, it does not  attempt to solve issues with Unity UI's design, it does not attempt to add a bunch of new features to Unity UI. It is a simple bridge between Unity UI and Rewired. It does not change how Unity UI works and it has no control over the vast majority of Unity UI functionality which is handled in the UI element components themselves. Once the input is received from Rewired and input events are sent out to the Event System, what happens after that is out of Rewired's responsibility or knowledge.</p>
    <p> The Rewired Standalone Input Module does nothing besides control input in Unity's UI system by changing the underlying input source from UnityEngine.Input to Rewired. If you are having difficulties with controlling the UI, please make sure your problems aren't really  pertaining to usage of Unity's UI system before contacting support. I frequently get questions that are actually issues with Unity UI setup and have nothing to do with Rewired. When in doubt, test with the StandaloneInputModule instead of the RewiredStandaloneInputModule. If the problem persists, you know that the issue is not with Rewired but rather something you've missed when setting up Unity UI. </p>
<p>Please refer to the <a href="https://docs.unity3d.com/Manual/com.unity.ugui.html">Unity UI documentation</a> and <a href="https://docs.unity3d.com/Manual/script-StandaloneInputModule.html">Unity documentation on the StandaloneInputModule</a> for basic usage.</p>
    <p>&nbsp;</p>
    <hr />
    <h3><a name="quick-setup" id="quick-setup"></a>Quick Setup</h3>
    <ol>
      <li>Create your Unity UI as per normal practice.</li>
      <li>Select the EventSystem object in the scene.</li>
      <li>Disable the StandaloneInputModule component on the EventSystem object.</li>
      <li>Add the RewiredStandaloneInputModule component to the EventSystem object.</li>
      <li>Customize the settings on the RewiredStandaloneInputModule if desired.</li>
      <li>Open the <a href="RewiredEditor.html">Rewired Editor</a> and create an Action for each of the controls listed in the RewiredStandaloneInputModule. By default, these are &quot;UIHorizontal&quot;, &quot;UIVertical&quot;, &quot;UISubmit&quot;, and &quot;UICancel.&quot; The names you create in the Rewired Editor must match exactly those in the RewiredStandaloneInputModule's inspector. If you'd like to change the names of these Actions, you may do so, but they must match between the Rewired Editor and the RewiredStandaloneInputModule.</li>
      <li>Create one or more Joystick, Keyboard, or CustomController maps with the Actions you created above assigned to elements.</li>
      <li>Assign the controller maps map(s) to one or more Player.</li>
      <li>Adjust the settings in the RewiredStandaloneInputModule to change which Player(s) input is drawn from and other options.</li>
  </ol>
    <p>Now your Unity UI should be controlled by Rewired instead of Unity's input system.</p>
    <p>&nbsp;</p>
    <hr />
    <h3><a name="event-system-and-component" id="event-system-and-component"></a>Event System and Component</h3>
    <p>You can either create a normal Unity Event System and replace the Standalone Input Module with the Rewired Standalone Input Module component or you can create a Rewired Event System from either of the menu items:</p>
    <ul>
      <li>GameObject -&gt; Create Other -&gt; Rewired -&gt; UI -&gt; Rewired Event System</li>
      <li>Window -&gt; Rewired -&gt; Create -&gt; UI -&gt; Rewired Event System    </li>
      </ul>
    <p>Rewired also comes with the RewiredEventSystem component which has the additional option to allow multiple Event Systems to run in the scene at the same time. This can be useful if you want to create  <a href="#faq-multiple-independent-uis">multiple independent UI's</a> for different Players.</p>
<p>&nbsp;</p>
<hr />
<h3><a name="rewired-actions" id="rewired-actions"></a>Rewired Actions</h3>
    <p><img src="files/images/rewiredstandaloneinputmodule_inspector_actions.png" class="right" />Four Actions must be set up in the Rewired Input Manager and the RewiredStandaloneInputModule in order to control the UI with a keyboard or joystick. <strong>These four Actions must have names that match exactly in both the Rewired Input Manager and the RewiredStandaloneInputModule</strong>.</p>
    <ol>
      <li>Horizontal Axis - The Action that will control Left/Right movement in the UI.</li>
      <li>Vertical Axis - The Action that will control Up/Down movement in the UI.</li>
      <li>Submit - The Action that submits a button.</li>
      <li>Cancel - The Action that cancels.</li>
  </ol>
      <p>The actual names you use are up to you. Of course these Actions must also be assigned to one or more keyboard or joystick maps and assigned to a Player to be functional. </p>
      <p>If you want to use <a href="#player-mouse">mouse pointers</a> exclusively to interact with the UI, you can set all these Actions to blank strings.</p>
      <p>Alternately, you can set Actions by id by enabling &quot;Set Actions By Id.&quot;</p>
      <p>NOTE: It is <strong>HIGHLY</strong> recommended that you create unique menu-only Actions for these UI controls in a separate controller map category from your game Actions. If you use your in-game actions such as &quot;Move Horizonal&quot; or &quot;Jump&quot; for these UI controls, you run the risk of allowing the user to render the UI unusable because they removed an assignment for one of these game Actions which was also  controlling the UI.</p>
<p>The settings in the RewiredStandaloneInputModule will determine which Players can control the UI. If you check &quot;Use All Rewired Game Players&quot;, all Players besides the System Player that have a map configured with these UI Actions will be able to control the UI. If you check &quot;Use Rewired System Player&quot;, the same will be true for the System Player. If instead you only want specific Players to control the UI, you can set these Player Ids individually.</p>
<p>If the UI control speed with a Joystick seems too slow or fast, adjust the &quot;Input Actions Per Second&quot; setting.</p>
<p>&nbsp;</p>
<hr />
<h3><a name="rewired-input-manager-settings" id="rewired-input-manager-settings"></a>Rewired Input Manager settings
</h3>
<p>This image shows the 4 actions that have been set up for controlling the UI with the keyboard or a joystick.</p>
<p><img src="files/images/controlmapper_rewiredinputmanager_uiactions.png" width="484" height="291" /></p>
<p>&nbsp;</p>
<p><strong>Unknown Controllers:</strong><br />
  It is recommended that you create a map for the <a href="ControllerMaps.html#unknown-controllers">Unknown Controller</a>. This way, if a user attaches a controller Rewired does not recognize, they should still be able to control the UI reasonably well.</p>
<p>There is no way to know what axes or buttons will actually be available on these controllers, but you can make some basic assumptions that should allow most controllers to control the UI.</p>
    <ul>
      <li>Axis 0: Map to your &quot;UIHorizontal&quot; Action. (Axis 0 is almost always the horizontal axis on the first joystick)</li>
      <li>Axis 1: Map to your &quot;UIVertical&quot; Action and Invert this axis. (Axis 1 is almost always the vertical axis on the first joystick and is always inverted.)</li>
      <li>Button 0: Map to your &quot;UISubmit&quot; Action.</li>
      <li>Button 1: Map to your &quot;UICancel&quot; Action.</li>
    </ul>
    <p><img src="files/images/controlmapper_unknowncontrollermap.png" width="712" height="171" /></p>
    <p>Of course, the above are only recommendations. You can set up your control scheme however you decide.</p>
    <p><strong>Mouse:</strong></p>
    <p>DO NOT map any UI Actions to Mouse buttons or axes. This is a very common mistake and will lead to many problems. <a href="#troubleshooting-duplicate-mouse-clicks">See this for more information</a>.</p>
    <p>&nbsp;</p>
    <hr />
    <h3><a name="inspector-options" id="inspector-options"></a>Inspector Options:</h3>
    <p><img src="files/images/rewiredstandaloneinputmodule_inspector.png" alt="Inspector" /></p>
    <table width="100%" border="1">
      <tr>
        <td>Rewired Input Manager</td>
        <td>(Optional) Link the Rewired Input Manager here for easier access to Player ids, etc.</td>
      </tr>
      <tr>
        <td>Use Playing Players Only</td>
        <td>Allow only Players with Player.isPlaying = true to control the UI.</td>
      </tr>
      <tr>
        <td>Use All Rewired Game Players</td>
        <td>Use all Rewired game Players to control the UI. This does not include the System Player. If enabled, this setting overrides individual Player Ids set in Rewired Player Ids.</td>
      </tr>
      <tr>
        <td>Use Rewired System Player</td>
        <td>Allow the Rewired System Player to control the UI.</td>
      </tr>
      <tr>
        <td>Rewired Player Ids</td>
        <td>A list of Player Ids that are allowed to control the UI. If Use All Rewired Game Players = True, this list will be ignored.</td>
      </tr>
      <tr>
        <td>Set Actions By Id</td>
        <td>If enabled, Action Ids will be used to set the Actions. If disabled, string names will be used to set the Actions.</td>
      </tr>
      <tr>
        <td><p>Horizontal Axis</p></td>
        <td>Name of the horizontal axis for movement (if axis events are used).</td>
      </tr>
      <tr>
        <td>Vertical Axis</td>
        <td>Name of the vertical axis for movement (if axis events are used).</td>
      </tr>
      <tr>
        <td>Submit Button</td>
        <td>Name of the action used to submit.</td>
      </tr>
      <tr>
        <td>Cancel Button</td>
        <td>Name of the action used to cancel.</td>
      </tr>
      <tr>
        <td>Input Actions Per Second</td>
        <td>Number of selection changes allowed per second when a movement button/axis is held in a direction.</td>
      </tr>
      <tr>
        <td>Repeat Delay</td>
        <td>Delay in seconds before vertical/horizontal movement starts repeating continouously when a movement direction is held.</td>
      </tr>
      <tr>
        <td>Move One Element Per Axis Press</td>
        <td>Makes an axis press always move only one UI selection. Enable if you do not want to allow scrolling through UI elements by holding an axis direction.</td>
      </tr>
      <tr>
        <td>Allow Mouse Input</td>
        <td>Allows the mouse to be used to select elements.</td>
      </tr>
      <tr>
        <td>Allow Mouse Input If Touch Supported</td>
        <td>Allows the mouse to be used to select elements if the device also supports touch control.</td>
      </tr>
      <tr>
        <td>Allow Touch Input</td>
        <td>Allows touch input to be used to select elements.</td>
      </tr>
      <tr>
        <td>Deselect If Background Clicked</td>
        <td>Deselects the current selection on mouse/touch click when the pointer is not over a selectable object.</td>
      </tr>
      <tr>
        <td>Deselect Before Selecting</td>
        <td>Deselects the current selection on mouse/touch click before selecting the next object.</td>
      </tr>
      <tr>
        <td>Force Module Active</td>
        <td>Forces the module to always be active.</td>
      </tr>
      <tr>
        <td>Player Mice</td>
        <td>Player Mice allowed to interact with the UI.  Each Player that owns a Player Mouse must also be allowed to control the UI or the Player Mouse will not function.</td>
      </tr>
    </table>
    <p>&nbsp;</p>
    <hr />
    <h3><a name="player-mouse" id="player-mouse"></a>Player Mouse:</h3>
    <p><strong>Background:</strong></p>
    <p>Unity's Standalone Input Module supports 3 methods of user interaction:    </p>
    <ul>
      <li>Mouse pointer interaction.</li>
      <li>Touch interaction.</li>
      <li>Keyboard, joystick, other interaction using the &quot;Selectable&quot; system.</li>
      </ul>
    <p>Mouse pointer and touch interaction work in a similar way, using a &quot;pointer&quot; screen position and &quot;clicks&quot; to send enter, exit, click, drag, etc. events to UI components. The pointer position must be over a UI element for the event to be sent.</p>
    <p>Keyboard, joystick, and other interaction work differently from mouse/touch in that they do not use a &quot;pointer&quot;, but instead use Unity's &quot;Selectable&quot; system which is part of the Event System and the individual UI components. The Event System supports a single &quot;currently selected&quot; GameObject which acts as the highlighted GameObject. UI element navigation happens when a UI element receives a navigation move event. Submit and Cancel happens when the currently selected GameObject is sent a Submit or Cancel event when the correct button/key is pressed.</p>
    <p><strong>Overview:</strong></p>
<p>The Rewired Standalone Input Module allows you to use a <a href="PlayerControllers.html#player-mouse">Player Mouse</a> to control a software mouse pointer using any input device to interact with the UI. This can be useful if you want to be able to interact with a UI using a gamepad but do not want the limitations of the &quot;Selectable&quot; UI system. You can also have multiple separate mouse pointers that can interact with the UI simultaneously*. (<a href="#player-mouse-mutli-player-ui-limitations">See important limitations / issues.</a>)</p>
<p>You do not have to use a Player Mouse for mouse pointer interaction to work. If you do not assign a Player Mouse, the default hardware mouse will be used which works just like the Standalone Input Module.</p>
<p><strong>Using a Player Mouse to control the UI:</strong></p>
<ul>
  <li>See <a href="PlayerControllers.html">Player Controllers</a> and <a href="PlayerControllers.html#player-mouse">Player Mouse</a> to understand the concepts.</li>
  <li>Create a GameObject with a Player Mouse component and configure its Player and element Actions.</li>
  <li>Create a pointer GameObject and drive it from the Player Mouse's screen position.</li>
  <li>Disable Raycast Target on the pointer's Image component or it will catch the mouse raycasts and block raycasts from hitting the UI elements below the pointer.</li>
  <li>Add the Player Mouse in the Rewired Standalone Input Module inspector (or add it through scripting at runtime).</li>
  <li>Make sure the Player that owns the Player Mouse is allowed to control the UI. (<a href="#inspector-options">See inspector options</a> for setting the Players that can control the UI.)</li>
  <li><em><a href="HowTos.html#enabling-disabling-controller-maps">Make sure you disable UI navigation Actions</a> in all Players that control a software pointer. If you have both UI navigation Actions controlling the UI and are moving a mouse pointer around with the same controls, the UI will be completely uncontrollable as the two control systems fight each other.</em></li>
</ul>
<p><strong>Using multiple Player Mouse pointers:</strong></p>
<p>You can use multiple Player Mice to drive multiple mouse pointers that can all interact with the UI.* (<a href="#player-mouse-mutli-player-ui-limitations">See important limitations.</a>) Simply create multiple Player Mice, set them up for each Player, and assign them to Player Mice field in the inspector.</p>
<p><strong>Examples:</strong></p>
<ul>
  <li><a href="Examples.html#player-mouse-unity-ui">Player Mouse Unity UI</a></li>
</ul>
<p><strong>Player Pointer Event Data</strong>:</p>
<p>The Rewired Standalone Input Module will send a PlayerPointerEventData object to all mouse pointer event handlers (Buttons, your scripts that implement the pointer event handler interfaces, etc.) If the handler script is written to support it, you can get Player, button index, and even source Player Mouse information from each event. See the <a href="Examples.html#player-mouse-unity-ui">Player Mouse Unity UI</a> example for a demonstration.</p>
<p>
  <a name="player-mouse-mutli-player-ui-limitations" id="player-mouse-mutli-player-ui-limitations"></a><strong>*Important Limitations / Issues:</strong></p>
<p>Unity's UI controls were not written to support interaction from multiple sources at the same time. Generally, UI controls work when being interacted with by multiple pointers, but there are some issues/artifacts:</p>
    <ul>
      <li>Selectable (Button, Toggle, Slider, etc.) highlighting shows artifacts when multiple pointers interact with it simultaneously. If two mouse pointers are pressing on a Button and one pointer moves out of the Button's area, a PointerExit event will be sent to the Button and it will no longer be highlighted. The pointer remaining over the Button can be clicking on the button, but the visual Button graphic will not show any change as the Button is clicked. The Button will still send events, but the visual feedback will be lost.</li>
      <li>Mutiple pointers trying to drag on a UI slider at the same time will yield unpredictable results.</li>
      <li>Probably others.</li>
    </ul>
<p>Rewired cannot overcome these inherent limitations of Unity UI. The only way to remedy these issues would be to replace all UI components and their base classes with new versions that are multi-pointer aware. This is outside the scope of Rewired, which as input system and not a replacement UI system.</p>
    <p>&nbsp;</p>
    <hr />
    <h3><strong><a name="troubleshooting" id="troubleshooting"></a></strong>Troubleshooting:</h3>
    <p>Before contacting support for RewiredStandaloneInputModule issues, be sure your issue has to do with Rewired and not just Unity's UI system in general.</p>
    <ul>
      <li>The Rewired Standalone Input Module does nothing besides control input in Unity's UI system by changing the underlying input source from UnityEngine.Input to Rewired. If you are having difficulties with controlling the UI, please make sure your problems aren't really  pertaining to usage of Unity's UI system before contacting support. I frequently get questions that are actually issues with Unity UI setup and have nothing to do with Rewired. When in doubt, test with the StandaloneInputModule instead of the RewiredStandaloneInputModule. If the problem persists, you know that the issue is not with Rewired but rather something you've missed when setting up Unity UI. </li>
      </ul>
    <p>Please refer to the <a href="https://docs.unity3d.com/Manual/com.unity.ugui.html">Unity UI documentation</a> and <a href="https://docs.unity3d.com/Manual/script-StandaloneInputModule.html">Unity documentation on the StandaloneInputModule</a> for basic usage.</p>
<p><strong><a name="troubleshooting-duplicate-mouse-clicks" id="troubleshooting-duplicate-mouse-clicks"></a>Problem: Receiving duplicate mouse clicks when clicking on a UI button</strong></p>
    <p>Do not assign UI Submit or Cancel Actions to Mouse Left Button or Mouse Right Button or you will receive double-clicks evey time the mouse button is pressed over a button. The mouse button click on a UI element is based on mouse cursor position and does not use the Action system.</p>
    <p>Unity's UI is designed to have two completely different systems for Keyboard/Joystick and Mouse. The Keyboard/Joystick system uses the Navigation system, which involves setting an active selected GameObject in the EventSystem, and the InputModule sends directional navigation events, OnSubmit, and OnCancel events to the currently selected Selectable GameObject in the Event System. This system is only for keyboard/joystick navigation.<br />
      <br />
      Mouse navigation does not use any of the above. It uses the mouse pointer position on-screen and the InputModule sends OnClick, OnPointerEnter, OnPointerExit, etc., events to the Selectable on the Game Object under the mouse pointer. Unity's system does not support a Cancel functionality for mouse input.<br />
      <br />
      Mapping OnSubmit or OnCancel to mouse buttons will cause the currently selected GameObject in the EventSystem (if one is selected) to receive these events regardless of where the mouse is on the screen. This is normally not what you want to happen when using a mouse pointer.</p>
    <p></p>
    <p><strong><a name="troubleshooting-joystick-keyboard-doesnt-work" id="troubleshooting-joystick-keyboard-doesnt-work"></a>Problem: Unity UI navigation with joystick or keyboard doesn't work</strong></p>
    <p>While this is a general Unity UI usage issue and not a Rewired issue in any way,  because I've received so many support requests where this ends up being the answer, I've decided to post it here.</p>
    <ul>
      <li><em>Unity UI cannot be controlled by keyboard or joystick unless you specify a current or starting Selectable GameObject in the Unity UI EventSystem.</em></li>
    </ul>
    <p>Unity UI requires a Selectable to be selected before any navigation will work for joystick or keyboard, otherwise it has no starting point from which to navigate when you press a key or a stick direction. You must either set the <a href="https://docs.unity3d.com/Manual/script-EventSystem.html" target="_blank">First Selected field in the inspector of the EventSystem component</a>, or set the current selected GameObject via scripting as shown below.<br />
    </p>
    <pre class="code">using UnityEngine.EventSystems;

void SetSelected(GameObject selectableObject) {
    <span class="comment">// Set the currently selected GameObject</span>
    EventSystem.current.<a href="https://docs.unity3d.com/ScriptReference/EventSystems.EventSystem.SetSelectedGameObject.html" target="_blank">SetSelectedGameObject</a>(selectableObject);
}<br />
    </pre>
    <p>Please refer to the <a href="https://docs.unity3d.com/Manual/UISystem.html" target="_blank">Unity documentation</a> for information on how to use Unity UI.</p>
    <p>&nbsp;</p>
    <hr />
    <p><strong><a name="troubleshooting-exceptions-in-callbacks-changing-settings" id="troubleshooting-exceptions-in-callbacks-changing-settings"></a>Problem: Exceptions thrown when making changes to various properties in the Rewired Standalone Input Module from a UI button press</strong></p>
    <p>You should not change certain properties in the Rewired Standalone Input Module from the callback of a UI button press or other UI event (the Action list, the Players list, Player Mouse list, etc.). The module executes its code sequentially, firing UI events synchronously, then continuing execution. If you change certain Rewired properties in the callback of one of these events, lists or objects may be change mid-execution causing it to throw an exception, for example, changing the list of Players that can control the UI in response to a UI button click. This list of Players will be changed, possible during iteration of the same list resulting in null reference exceptions or index out of range exceptions. This is akin to modifying a List in the middle of a foreach loop, which will throw an exception because they have included measures to watch for such illegal operations.</p>
    <p>If you must change a Rewired property from a UI event, use a Coroutine to defer execution of the change until the end of the frame.</p>
    <p>&nbsp;</p>
    <hr />
    <h3><a name="faq" id="faq"></a>FAQ:</h3>
    <p class="question">Does it support multi-player UIs?</p>
    <p>Only partially through the use of <a href="#player-mouse">Player Mouse pointers</a> or by creating a separate independent UI for each Player.</p>
    <p>It does not support shared multi-player UI navigation using the Unity UI Selectable system. (The system used for joystick/keyboard navigation.)</p>
    <p>The issue here is Unity's   UI controls and Event System do not support more 
      than one simultaneous &quot;selected&quot;   object. Their entire system is designed 
      around the concept of one single   user and one selection at a time. The Rewired Standalone Input Module cannot overcome the inherent limitations of Unity's UI system. Supporting multiple   simultaneous Selectables would require a complete 
      rewrite of Unity's  Event System and all interactable UI components including Button, Toggle, Slider, etc., and their base classes with new versions that are multi-pointer aware including a new highlighting/transition system. This is outside the scope of Rewired, which is an input system and not a replacement UI system.</p>
    <p><a name="faq-multiple-independent-uis" id="faq-multiple-independent-uis"></a>Multiple Independent UI's</p>
    <p>You can, however, create multiple independent UI's for each Player by creating multiple Rewired Event Systems and enabling Always Update on each Rewired Event System in the inspector. Each event system will have its own Rewired Standalone Input Module with its own settings. Each event system will have its own selectable controllable by the Players designated to control it in the Rewired Standalone Input Module.</p>
    <p>You must take care when working with mouse input. If you allow mouse input to control multiple event systems, clicking on a Selectable object with the mouse will cause all event systems to select that same GameObject. This is unlikely to be desirable, so you need to manage which event systems are allowed mouse control. This can be done by disabling mouse input on all but one event system or by using Player Mouse to handle mouse input on all event systems and designating only one Player Mouse to use the hardware pointer position.<br />
    </p>
<div class="bottom-pager clearfix">
  <a class="back-button" href="Actions.html" title="Actions"><span class="button-img"></span></a><a class="back-button" href="Documentation.html" title="Actions">Documentation</a></div>
<!-- InstanceEndEditable -->
        </div>
        
    </div>
  <div class="footer clearfix">
   	<p class="left">Copyright &copy;2014-2021 <a href="https://guavaman.com" title="Guavaman Enterprises">Guavaman Enterprises</a>. All rights reserved. No materials may be reproduced without permission.</p>
  	<p class="right"><a href="https://guavaman.com/projects/rewired" title="Return to Rewired Website">Return to Rewired Website</a></p>
  </div>
  <!-- end .content --></div>
  <!-- end .container --></div>
  
  
</body>
<!-- InstanceEnd --></html>
